#! /bin/sh
# Miggbzo -- apply MIGration by Gaussian Beams for Zero Offset
set -x

demo=5

nt=500 dt=.004 ft=0.0 dtsegy=4000
nx=250 dx=80  fx=0.0
nz=500 dz=20  fz=0.0
#fmin=10 fmax=50    # see param2 in model.dir 

# make velocity function
cd miggbzo.dir

# create the background velocity models
Unif2

# put su headers on data
suaddhead < demo${demo}traces ns=500  ftn=1 |
sushw key=dt a=$dtsegy > junk.su

# plot background velocity model 2 --- 3 layer model
xmovie < junkv n1=$nz n2=$nx -geometry 560x460+0+650 \
title="Background Velocity Demo $demo" \
d1=$dz d2=$dx &

dz=3
# Gaussian beam migration; use background velocity model
sumiggbzo <junk.su >junkmgb vfile=junkv verbose=1 \
	 dt=$dt dx=$dx dz=$dz nz=$nz fz=$fz \
	fmin=$fmin fmax=$fmax

# plot output of gb migration with model 2 velocity profile
suximage <junkmgb  perc=99  -geometry 560x460-0-0 \
	label1="Depth" label2="Distance" \
	title="Gaussian Beam Migration $demo" &

exit 0
